<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2021/9/9
  Time: 22:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>注册</title>

    <meta name="content-type" content="text/html; charset=UTF-8">
    <?xml encoding="UTF-8"?>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

    <link rel="stylesheet" type="text/css" href="css/logintest.css">


    <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" >

        function validateForm(){
            let uname = document.forms["enroll"]["enrollName"].value;
            let upwd = document.forms["enroll"]["enrollPwd"].value;
            if (uname ==null || uname ==="")
            {
                alert("姓名必须填写！");
                return false;
            }else if (upwd ==null || upwd ==="")
            {
                alert("密码不能为空！");
                return false;
            }
        }

    </script>



</head>

<body>
<div class="segment">
    <h1>注册</h1>
</div>
<center>

    <form name="enroll"  action="enrollServlet" onsubmit="return validateForm()" method = "get">

        <label class="label1">
            <input  type = "text" name = "enrollAccount" placeholder="身份证号/上班工号" class="input1">
        </label>
        <label class="label1">
            <input  type = "password" name = "enrollPwd" placeholder="密码" class="input1">
        </label>
        <label class="label1">
            <select class="input1">
                <option value="">请选择用户类型</option>
                <option value ="0">病人</option>
            </select>
        </label>
        <input  type = "submit" value = "注册"  class="sub">&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="login.jsp"><input type="button" value="返回"  class="sub"></a>

    </form>
</center>



</body>


</html>
